import win32api
import win32con
from datetime import datetime
import time
from winotify import Notification
import os

from utils.log import logger
from utils.config import config

img_relative_path = os.path.join(os.getcwd()+"/icon/","Genshin.jpg")

def notif(title,msg):
    Notification(app_id="Flet_Test",title=title,msg=msg,icon=img_relative_path).show()
    if config.enable_log_Flag is True:
        logger.info("下班提醒触发")

def set_alarm(target_hour, target_minute, msg):
    global count
    now = datetime.now()
    if now.hour  == target_hour and now.minute  == target_minute:
        if count == 0:
            notif("下班提醒", msg)
            count = 1
    else:
        count = 0